 <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page session="true" import="servlets.*" %>
<%@ page session="true" import="classes.*" %>

<%@ page session="true" import="beans.*" %>
<%@ page session="true" import="java.sql.ResultSet" %>

<%  	session = request.getSession(true); %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@page import="java.util.List"%><html class="js" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Sistema de Noticias</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 
<%@ include file="inc_head.jsp" %>  

</head>
<body>  
<div id="page"> 



      <div id="content"> 
        <div class="dbx-box" id="block-block"> 
          <div> 
            <% if (request.getParameter("msg_sucesso") != null) { %> 
            <div id="msg_sucesso"><% out.print(request.getParameter("msg_sucesso")); %></div>
            <% } %>
              <% if (request.getParameter("msg_erro") != null) { %> 
            <div id="msg_erro"><% out.print(request.getParameter("msg_erro")); %></div>
            <% } %> 
            
            
			<%  	long id_noticia = (long)Integer.parseInt("" + session.getValue("id_noticia")); %> 

				
            <h1>Adicionar Videos</h1>

  
  
				<%  	List<Video> videos = (List<Video>)session.getValue("videosNaoUsados"); %> 
				   
				<% for(int i = 0; i < videos.size(); i++) {
					Video video = (Video)videos.get(i); 
					if(i%2 == 0 && i > 1) {
						out.print("<div style=\"clear:both\"></div>");
					} 
				%>  
            
                    <div class="imagempeq"> 
                    
                        	<strong> <%  out.print(video.getTitulo());   %> </strong> 
      
                         	
                        	  <br /><%  out.print(video.getHTMLpeq());   %>   <br />
                   			[<a href="NoticiasVideosAdd?id=<%  out.print(video.getId()); %>&id_noticia=<%  out.print(id_noticia); %>">Adicionar </a>]
                   </div>  
                   
                    
                <%    
				}
				%>   
    <br /><div style="clear:both"></div><br />				
		<% List<Video> videosUsados = (List<Video>)session.getValue("videosUsados"); %>				
		<% if(videosUsados.size() > 0 ) { %>		
				<br />
           <h1>Remover Video</h1>

  
  
				<%  	videos = videosUsados; %> 
				   
				<% for(int i = 0; i < videos.size(); i++) {
					Video video = (Video)videos.get(i); 
					if(i%2 == 0 && i > 1) {
						out.print("<div style=\"clear:both\"></div>");
					} 
				%>  
            
                    <div class="video"> 
                    
                        	<strong> <%  out.print(video.getTitulo());   %> </strong> 
      
                         	
                        	  <br /><%  out.print(video.getHTMLpeq());   %>   <br /> 
                   			[<a href="NoticiasVideosDelete?id=<%  out.print(video.getId()); %>&id_noticia=<%  out.print(id_noticia); %>">
                         		Remover 
                         	</a>]
                   </div>  
                   
                    
                <%    
				}
				%>   
               <%    
			}
			%>  
     <br /><div style="clear:both"></div><br />
     
  </div> 
</div> 
</body>
</html>
